{extend name="public/info_base"}

{block name="title"}
中国酒业兄弟连一一资料填报
{/block}

{block name="style"}

<link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
<link rel="stylesheet" href="__STATIC__/home/css/summary.css">
<link rel="stylesheet" href="__STATIC__/home/jquery_weui/css/swiper.min.css"/>
<!--<link rel="stylesheet" type="text/css" href="__STATIC__/home/jquery_weui/lib/weui.min.css">-->
<!--jquery-weui.min.css-->
<link rel="stylesheet" type="text/css" href="__STATIC__/home/jquery_weui/css/jquery-weui.min.css">

<style>
    .layui-btn {
        margin-bottom: 20px;
    }
    @media screen and (max-width: 500px) {
        .main_detail {
            width: auto;
            font-size: 14px;
        }
    }
    .layui-input {
        height: 30px;
    }
    .layui-form-label {
        padding: 2px;
        width: 105px;
    }
    @media screen and (max-width: 450px) {
        .layui-form-item .layui-input-inline {
            display: flex;
            flex-direction: column;
        }
    }
    #img{
        margin-top: .3rem;
    }
    .layui-input-inline.layui-input-inline1{
        display: flex;
        flex-direction: row;
    }
    .layui-input-inline1>div:last-child{
        margin-left: .5rem;
    }
</style>
{/block}

{block name="body"}
<div class="articleList-big">
    {include file="public/header" /}
    {include file="public/nav" /}
    {include file="public/banner" /}
    <div class="main">
        <div class="summary_lf">
            <ul>
                <li class="bg-9d">资料填报</li>

                <a href="" class="summary_a"><img src="__STATIC__/home/images/mao1.png" alt=""/></a>
                <a href="" class="summary_a"><img src="__STATIC__/home/images/mao1.png" alt=""/></a>
            </ul>
        </div>
        <div class="summary_rt">
            <div class="summary_rt_a">
                <div class="toRight"></div>
                <div class="summary_rt_top">
                    <span class="top_san"></span>
                    <span>当前位置 : </span>
                    <span>首页 </span>
                    <span class="cl-9d">&gt;  资料填报 </span>
                </div>
            </div>
            <!--常规-->
            <div class="top_two active">
                <span class="top_two_img"></span>
                <span class="cl-9d">活动确认</span>
            </div>
            <div class="main_detail">
                <div class="title">
                    <h2>{$data.title}</h2>
                </div>

                <div class="content">
                    <form class="layui-form" action="">
                        <div class="layui-form-item">
                            <label class="layui-form-label">姓名：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="name" name="enterprise" lay-verify="required" placeholder="兄弟姓名（必填）" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">推荐人：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="recommend" name="enterprise" lay-verify="required" placeholder="推荐人姓名" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">推荐人电话：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="recommendtel" name="enterprise" lay-verify="required" placeholder="推荐人电话" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">性别：</label>
                            <div class="layui-input-inline">
                                <div><input name="item" class="sex" type="radio" value='男' />男</div>
                                <div><input name="item" class="sex" type="radio" value='女' />女</div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">民族：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="national" name="enterprise" lay-verify="required" placeholder="民族（必填）" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">出生年月：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="birthday" name="enterprise" lay-verify="required" placeholder="出生年月（必填）" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">身高：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="height" name="enterprise" lay-verify="required" placeholder="身高cm（必填）" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">省、市、区：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="dizi" class="weui-input addressDetail" placeholder="请填写您常住的地址区域">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">现居住地：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="live" name="enterprise" lay-verify="required" placeholder="现居住地（必填）" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">籍贯：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="native" name="enterprise" lay-verify="required" placeholder="籍贯（必填）" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">电话：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="tel" name="enterprise" lay-verify="required" placeholder="电话（必填）" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">邮箱：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="email" name="enterprise" lay-verify="required" placeholder="邮箱（必填）" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">兄弟连职务：</label>
                            <div class="layui-input-inline">
                                <select id="duty">
                                    {foreach name='res' item='vo'}
                                    <option value="{$vo.id}">{$vo.position}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">QQ号码：</label>
                        <div class="layui-input-inline">
                            <input type="text" id="QQ" name="enterprise" lay-verify="required" placeholder="QQ联系（必填）" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">所属大区联队：</label>
                        <div class="layui-input-inline">
                           <!-- <input type="text" id="united" name="enterprise" lay-verify="required" placeholder="所属大区联队（必填）" autocomplete="off" class="layui-input">-->
                            <select id="united">
                               {foreach name='list' item='vo'}
                                <option value="{$vo.id}">{$vo.region}</option>

                               {/foreach}
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">紧急联系人：</label>
                        <div class="layui-input-inline">
                            <input type="text" id="contact" name="enterprise" lay-verify="required" placeholder="紧急联系人（必填）" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">电话：</label>
                        <div class="layui-input-inline">
                            <input type="text" id="contactel" name="enterprise" lay-verify="required" placeholder="电话（必填）" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">照片（头像）：</label>
                            <div class="layui-input-inline">
                                <img id="head" src="__STATIC__/home/images/g1.png" style="width:50px;height:50px;">
                                <input class="fileInput" type="file" class="myUpload" name="photos[]" accept="image/*" multiple id="img" capture="camera"/>
                                <input type="hidden" id="iod" value=""/>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">学历：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="education" name="enterprise" lay-verify="required" placeholder="学历" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">专业：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="majors" name="enterprise" lay-verify="required" placeholder="专业" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">政治面貌：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="politik" name="enterprise" lay-verify="required" placeholder="政治面貌" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <!--<div class="layui-form-item">
                            <label class="layui-form-label">就读时间：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="school_time" name="enterprise" lay-verify="required" placeholder="就读时间" autocomplete="off" class="layui-input">
                            </div>
                        </div>-->
                        <div class="layui-form-item">
                            <label class="layui-form-label">就读学校：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="school" name="enterprise" lay-verify="required" placeholder="就读学校" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <!--<div class="layui-form-item">
                            <label class="layui-form-label">主修课程：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="courses" name="enterprise" lay-verify="required" placeholder="主修课程" autocomplete="off" class="layui-input">
                            </div>
                        </div>-->

                        <div class="layui-form-item">
                            <label class="layui-form-label">工作经历：</label>
                            <div class="layui-input-inline">
                                <textarea  maxlength='30' id="experience" class="weui-textarea area" placeholder="工作经历" rows="3"></textarea>
                            </div>
                        </div>
                        <!--<div class="layui-form-item">
                            <label class="layui-form-label">获奖情况：</label>
                            <div class="layui-input-inline">
                                <textarea maxlength='30' id="palm" class="weui-textarea area" placeholder="获奖情况" rows="3"></textarea>
                            </div>
                        </div>-->
                       <!-- <div class="layui-form-item">
                            <label class="layui-form-label">专业技能：</label>
                            <div class="layui-input-inline">
                                <textarea maxlength='30' id="skill" class="weui-textarea area" placeholder="专业技能" rows="3"></textarea>
                            </div>
                        </div>-->
                        <div class="layui-form-item">
                            <label class="layui-form-label">兴趣爱好：</label>
                            <div class="layui-input-inline">
                                <textarea maxlength='30' id="hobby" class="weui-textarea area" placeholder="兴趣爱好" rows="3"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">个人荣誉：</label>
                            <div class="layui-input-inline">
                                <textarea maxlength='30' id="practice" class="weui-textarea area" placeholder="社会实践" rows="3"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">个性评价：</label>
                            <div class="layui-input-inline">
                                <textarea maxlength='30' id="evaluation" class="weui-textarea area" placeholder="个性评价" rows="3"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="activity_id" value="{$data.id}">
                                <button class="layui-btn" id="submit" type="submit">立即提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="clear"></div>
    {include file="public/footer" /}
</div>
<div class="articleList-little">
    <div class="articleList-little_top">
        <span>兄弟连成员 </span>
        <span class="cl-9d">&gt; 资料填报 </span>
    </div>
    <div class="main_detail">
        <div class="title">
            <h2>
                {$data.title}
            </h2>
        </div>
        <div class="content">
            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label">推荐人：</label>
                    <div class="layui-input-inline">
                        <input type="text" id="recommend1" name="enterprise" lay-verify="required" placeholder="兄弟姓名（必填）" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">推荐人电话：</label>
                    <div class="layui-input-inline">
                        <input type="text" id="recommendtel1" name="enterprise" lay-verify="required" placeholder="兄弟姓名（必填）" autocomplete="off" class="layui-input">
                    </div>
                </div>
            <div class="layui-form-item">
                <label class="layui-form-label">姓名：</label>
                <div class="layui-input-inline">
                    <input type="text" id="name1" name="enterprise" lay-verify="required" placeholder="兄弟姓名（必填）" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">性别：</label>
                <div class="layui-input-inline layui-input-inline1">
                    <!--<input type="text" id="sex" name="enterprise" lay-verify="required" placeholder="性别（必填）" autocomplete="off" class="layui-input">-->
                    <div><input name="item" class="sex" type="radio" value='男' />男</div>
                    <div><input name="item" class="sex" type="radio" value='女' />女</div>

                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">民族：</label>
                <div class="layui-input-inline">
                    <input type="text" id="national1" name="enterprise" lay-verify="required" placeholder="民族（必填）" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">出生年月：</label>
                <div class="layui-input-inline">
                    <input type="text" id="birthday1" name="enterprise" lay-verify="required" placeholder="出生年月（必填）" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">身高：</label>
                <div class="layui-input-inline">
                    <input type="text" id="height1" name="enterprise" lay-verify="required" placeholder="身高cm（必填）" autocomplete="off" class="layui-input">
                </div>
            </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">所属大区联队：</label>
                    <div class="layui-input-inline">
                        <!-- <input type="text" id="united" name="enterprise" lay-verify="required" placeholder="所属大区联队（f必填）" autocomplete="off" class="layui-input">-->
                        <select id="united1">
                            {foreach name='list' item='vo'}
                            <option value="{$vo.id}">{$vo.region}</option>

                            {/foreach}
                        </select>
                    </div>
                </div>
            <div class="layui-form-item">
                <label class="layui-form-label">省、市、区：</label>
                <div class="layui-input-inline">
                    <input type="text" id="dizi1" class="weui-input addressDetail" placeholder="请填写您常住的地址区域"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">现居住地：</label>
                <div class="layui-input-inline">
                    <input type="text" id="live1" name="enterprise" lay-verify="required" placeholder="现居住地（必填）" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">籍贯：</label>
                <div class="layui-input-inline">
                    <input type="text" id="native1" name="enterprise" lay-verify="required" placeholder="籍贯（必填）" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">电话：</label>
                <div class="layui-input-inline">
                    <input type="text" id="tel1" name="enterprise" lay-verify="required" placeholder="电话（必填）" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">邮箱：</label>
                <div class="layui-input-inline">
                    <input type="text" id="email1" name="enterprise" lay-verify="required" placeholder="邮箱（必填）" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">兄弟连职务：</label>
                <div class="layui-input-inline">
                    <select id="duty1">
                        {foreach name='res' item='vo'}
                        <option value="{$vo.id}">{$vo.position}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">QQ号码：</label>
                <div class="layui-input-inline">
                    <input type="text" id="QQ1" name="enterprise" lay-verify="required" placeholder="QQ号码（必填）" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">紧急联系人：</label>
                <div class="layui-input-inline">
                    <input type="text" id="contact1" name="enterprise" lay-verify="required" placeholder="紧急联系人（必填）" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">电话：</label>
                <div class="layui-input-inline">
                    <input type="text" id="contactel1" name="enterprise" lay-verify="required" placeholder="电话（必填）" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">照片（头像）：</label>
                <div class="layui-input-inline">
                    <img id="head1" src="__STATIC__/home/images/cuan1.png" style="width:50px;height:50px;">
                    <input class="fileInput" type="file" class="myUpload" name="photos[]" accept="image/*" multiple id="img1" capture="camera"/>
                    <input type="hidden" id="iod1" value=""/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">学历：</label>
                <div class="layui-input-inline">
                    <input type="text" id="education1" name="enterprise" lay-verify="required" placeholder="学历" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">专业：</label>
                <div class="layui-input-inline">
                    <input type="text" id="majors1" name="enterprise" lay-verify="required" placeholder="专业" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">政治面貌：</label>
                <div class="layui-input-inline">
                    <input type="text" id="politik1" name="enterprise" lay-verify="required" placeholder="政治面貌" autocomplete="off" class="layui-input">
                </div>
            </div>
           <!-- <div class="layui-form-item">
                <label class="layui-form-label">就读时间：</label>
                <div class="layui-input-inline">
                    <input type="text" id="school_time1" name="enterprise" lay-verify="required" placeholder="就读时间" autocomplete="off" class="layui-input">
                </div>
            </div>-->
            <div class="layui-form-item">
                <label class="layui-form-label">毕业学校：</label>
                <div class="layui-input-inline">
                    <input type="text" id="school1" name="enterprise" lay-verify="required" placeholder="就读学校" autocomplete="off" class="layui-input">
                </div>
            </div>
            <!--<div class="layui-form-item">
                <label class="layui-form-label">主修课程：</label>
                <div class="layui-input-inline">
                    <input type="text" id="courses1" name="enterprise" lay-verify="required" placeholder="主修课程" autocomplete="off" class="layui-input">
                </div>
            </div>-->

            <div class="layui-form-item">
                <label class="layui-form-label">工作经历：</label>
                <div class="layui-input-inline">
                    <textarea  maxlength='30' id="experience1" class="weui-textarea area" placeholder="工作经历" rows="3"></textarea>
                </div>
            </div>
            <!--<div class="layui-form-item">
                <label class="layui-form-label">获奖情况：</label>
                <div class="layui-input-inline">
                    <textarea maxlength='30' id="palm1" class="weui-textarea area" placeholder="获奖情况" rows="3"></textarea>
                </div>
            </div>-->
          <!--  <div class="layui-form-item">
                <label class="layui-form-label">专业技能：</label>
                <div class="layui-input-inline">
                    <textarea maxlength='30' id="skill1" class="weui-textarea area" placeholder="专业技能" rows="3"></textarea>
                </div>
            </div>-->
            <div class="layui-form-item">
                <label class="layui-form-label">兴趣爱好：</label>
                <div class="layui-input-inline">
                    <textarea maxlength='30' id="hobby1" class="weui-textarea area" placeholder="兴趣爱好" rows="3"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">个人荣誉：</label>
                <div class="layui-input-inline">
                    <textarea maxlength='30' id="practice1" class="weui-textarea area" placeholder="个人荣誉" rows="3"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">个性评价：</label>
                <div class="layui-input-inline">
                    <textarea maxlength='30' id="evaluation1" class="weui-textarea area" placeholder="个性评价" rows="3"></textarea>
                </div>
            </div>
            <input type="hidden" id="activity_id" value="{$data.id}">
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="hidden" name="activity_id" value="{$data.id}">
                    <button class="layui-btn" id="submit1" type="submit">立即提交</button>
                </div>
            </div>
            </form>
        </div>

        <div style="width: 7rem; height:7rem; display: block; margin: 1rem auto;" >
            <img src="__STATIC__/home/images/top5.png"/>
        </div>
    </div>
</div>
{/block}

{block name="javascript"}
{notempty name="signPackage"}
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
    wx.config({
            //debug: true,
            appId: '{$signPackage.appId}',
            timestamp: {$signPackage.timestamp},
        nonceStr:'{$signPackage.nonceStr}',
        signature: '{$signPackage.signature}',
        jsApiList: [
        // 所有要调用的 API 都要加到这个列表中
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'hideMenuItems'
    ]
    });
    wx.ready(function () {
        // 在这里调用 API
        wx.checkJsApi({
            jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'hideMenuItems'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
            success: function(res) {
//                alert(res.checkResult.onMenuShareTimeline);
//                alert(res.errMsg);
                //console.log(res);
                // 以键值对的形式返回，可用的api值true，不可用为false
                // 如：{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
            }
        });

        wx.onMenuShareTimeline({
            title: '中国酒业兄弟连一一资料填报', // 分享标题
            desc : '为了兄弟连更好的开展工作，请兄弟连兄递认真填写个人资料，辛苦了！',
            link: window.location.href, // 分享链接
            imgUrl: 'http://'+window.location.host+'/{$data.image|default="static/home/images/lo_03.png"}', // 分享图标
            success: function () {
                alert('成功');
                // 用户确认分享后执行的回调函数
            },
            cancel: function () {
                alert('取消');
                // 用户取消分享后执行的回调函数
            }
        });

        wx.onMenuShareAppMessage({
            title: '中国酒业兄弟连一一资料填报', // 分享标题
            desc : '为了兄弟连更好的开展工作，请兄弟连兄递认真填写个人资料，辛苦了！',
            link: window.location.href, // 分享链接
            imgUrl: 'http://'+window.location.host+'/{$data.image|default="static/home/images/lo_03.png"}', // 分享图标
            type: '', // 分享类型,music、video或link，不填默认为link
            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
            success: function () {
                alert('成功');
                // 用户确认分享后执行的回调函数
            },
            cancel: function () {
                alert('取消');
                // 用户取消分享后执行的回调函数
            }
        });
        wx.hideMenuItems({
            menuList: ['menuItem:share:qq', 'menuItem:share:weiboApp', 'menuItem:favorite', 'menuItem:share:QZone', "menuItem:copyUrl", 'menuItem:openWithQQBrowser', 'menuItem:share:email', 'menuItem:openWithSafari'] // 要显示的菜单项，所有menu项见附录3
        });
    });
</script>
{/notempty}

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script type="text/javascript" src="__STATIC__/home/jquery_weui/lib/jquery-2.1.4.js"></script>
<!-- jquery-weui.min.js -->
<script type="text/javascript" src="__STATIC__/home/jquery_weui/js/jquery-weui.min.js"></script>
<script src="__STATIC__/home/jquery_weui/js/data-picker1.js"></script>
<script src="__STATIC__/home/jquery_weui/js/city-picker.js"></script>

<script>
    $("#birthday").datetimePicker();
    $("#school_time").datetimePicker();
    $("#birthday1").datetimePicker();
    $("#school_time1").datetimePicker();
    $(function () {
        $(".addressDetail").cityPicker({
            title: "请选择收货地址",
            onChange: function (picker, values, displayValues) {
                console.log(values, displayValues);
            }
        });

        $('form').submit(function () {

            var send = 1;
            $(this).find('input[type="text"]').each(function (i, d) {
                if(!$(this).val()) {
                    $(this).val('').focus();
                    send = 0;
                    return false;
                }
                if($(this).attr('name') == 'mobile') {
                    if (!$(this).val().match(/^1[3|4|5|7|8][0-9]\d{4,8}$/i)) {
                        alert("手机号码格式不正确！");
                        $(this).focus();
                        send = 0;
                        return false;
                    }
                }
            });
            if (send == 0) {
                return false;
            }
            $.ajax({
                type : 'POST',
                url : '?',
                data : $(this).serialize(),
                dataType : 'json',
                success : function (msg) {
                    if (msg.code == 200) {
                        alert('提交成功');
                        window.history.back();
                    } else {
                        alert(msg.msg);
                    }
                }
            });
            return false;
        });
    });
    /*shouji*/
    $("#submit1").click(function (){
        var name = $("#name1").val();//姓名
        var sex = $("input[name='item']:checked").val();
        //var sex = $("#sex").val();//性别
        var national = $("#national1").val();//民族
        var birthday = $("#birthday1").val();//出生年月
        var height = $("#height1").val();//身高
        var live = $("#live1").val();//现居住地
        var native = $("#native1").val();//籍贯
        var tel = $("#tel1").val();//电话
        var email = $("#email1").val();//邮箱
        var duty = $("#duty1").val();//兄弟连职务
        var head = $("#iod1").val();//头像

        var education = $("#education1").val();//个性评价
        var dizi = $("#dizi1").val();//省市区地址

        var QQ = $("#QQ1").val();//QQ号
        //var united = $("#united").val();//所属大区联队
        var united = $('#united1 option:selected') .val();
        var contact = $("#contact1").val();//紧急联系人
        var contactel = $("#contactel1").val();//紧急联系人电话

        var majors = $("#majors1").val();
        var politik = $("#politik1").val();
        //var school_time = $("#school_time1").val();
        var school = $("#school1").val();
        //var courses = $("#courses1").val();
        var experience = $("#experience1").val();
       // var palm = $("#palm1").val();
        //var skill = $("#skill1").val();
        var hobby = $("#hobby1").val();
        var practice = $("#practice1").val();//个人荣誉
        var evaluation = $("#evaluation1").val();
        var activity_id = $("#activity_id").val();
        var recommend = $("#recommend1").val();
        var recommendtel = $("#recommendtel1").val();

        re= /^0?(13|14|15|17|18)[0-9]{9}$/
        if(!re.test(tel)){
            alert('请填写正确的电话号码');return;
        }
        if(!/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test(email)){
            alert('请填写正确的邮箱');return;
        }
        if(name ==""||sex ==""||national ==""||birthday ==""||height ==""||live ==""||native ==""||tel ==""||email ==""||duty==""||head==""||education==""||QQ ==""||united==""||contact ==""||contactel =="" ||dizi==""){
            alert('请补齐必填的信息');return;
        }
        $.ajax({
              type:'post',
              data:{name:name,sex:sex,national:national,birthday:birthday,height:height,live:live,native:native,tel:tel,email:email, duty:duty,head:head,education:education,majors:majors,politik:politik,school:school,experience:experience,hobby:hobby,practice:practice,evaluation:evaluation,activity_id:activity_id,QQ:QQ,united:united,contact:contact,contactel:contactel,dizi:dizi,recommend:recommend,recommendtel:recommendtel},
              url:'/Index/activity/submit',
              success:function (data){
                  if(data =="1"){
                      alert("报名成功");
                  }else if(data =="-2"){
                      alert("手机号已存在");
                  }else{
                      alert("报名失败，请确认信息的准确");
                  }
              }
        })
    });
    /*pc*/
    $("#submit").click(function (){
        var name = $("#name").val();//姓名
        var sex = $("input[name='item']:checked").val();
        //var sex = $("#sex").val();//性别
        var national = $("#national").val();//民族
        var birthday = $("#birthday").val();//出生年月
        var height = $("#height").val();//身高
        var live = $("#live").val();//现居住地
        var native = $("#native").val();//籍贯
        var tel = $("#tel").val();//电话
        var email = $("#email").val();//邮箱
        var duty = $("#duty").val();//兄弟连职务
        var head = $("#iod").val();//头像
        var education = $("#education").val();//个性评价
        var dizi = $("#dizi").val();//省市区地址
        var QQ = $("#QQ").val();//QQ号
        //var united = $("#united").val();//所属大区联队
        var united = $('#united option:selected') .val();
        var contact = $("#contact").val();//紧急联系人
        var contactel = $("#contactel1").val();//紧急联系人电话

        var majors = $("#majors").val();
        var politik = $("#politik").val();
       // var school_time = $("#school_time").val();
        var school = $("#school").val();
        //var courses = $("#courses").val();
        var experience = $("#experience").val();
        //var palm = $("#palm").val();
        //var skill = $("#skill").val();
        var hobby = $("#hobby").val();
        var practice = $("#practice").val();//个人荣誉
        var evaluation = $("#evaluation").val();
        var activity_id = $("#activity_id").val();
        var recommend = $("#recommend").val();
        var recommendtel = $("#recommendtel").val();
        re= /^0?(13|14|15|17|18)[0-9]{9}$/
        if(!re.test(tel)){
            alert('请填写正确的电话号码');return;
        }
        if(!/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test(email)){
            alert('请填写正确的邮箱');return;
        }
        if(name ==""||sex ==""||national ==""||birthday ==""||height ==""||live ==""||native ==""||tel ==""||email ==""||duty==""||head==""||education==""||QQ ==""||united==""||contact ==""||contactel =="" ||dizi==""){
            alert('请补齐必填的信息');return;
        }
        $.ajax({
            type:'post',
            data:{name:name,sex:sex,national:national,birthday:birthday,height:height,live:live,native:native,tel:tel,email:email, duty:duty,head:head,education:education,majors:majors,politik:politik,school:school,experience:experience,hobby:hobby,practice:practice,evaluation:evaluation,activity_id:activity_id,QQ:QQ,united:united,contact:contact,contactel:contactel,dizi:dizi,recommend:recommend,recommendtel:recommendtel},
            url:'/Index/activity/submit',
            success:function (data){
                if(data =="1"){
                    alert("报名成功");
                }else if(data =="-2"){
                    alert("手机号已存在");
                }else{
                    alert("报名失败，请确认信息的准确");
                }
            }
        })
    });
    /*上传图片 a*/
    $("#img1").change(function(){
        var filess = this.files[0];
        var src=getObjectURL(filess);//获取上传文件的路径fg
        var formData = new FormData();

        formData.append("fb_img",this.files[0]);
        $.ajax({
            url:"/Index/activity/upload_phead",
            data:formData,
            processData: false,
            contentType: false,
            type:"post",
            success:function(data){
                    $("#head1").attr('src', data);
                    $("#iod1").val(data);
            },
        });
    });
    /*上传图片 a*/
    $("#img").change(function(){
        var filess = this.files[0];
        var src=getObjectURL(filess);//获取上传文件的路径fg
        var formData = new FormData();

        formData.append("fb_img",this.files[0]);
        $.ajax({
            url:"/Index/activity/upload_phead",
            data:formData,
            processData: false,
            contentType: false,
            type:"post",
            success:function(data){

                $("#head").attr('src', data);
                $("#iod").val(data);
            },
        });
    });
    //获取上传文件的url
    function getObjectURL(file)
    {
        var url = null;
        if (window.createObjectURL != undefined)
        {
            url = window.createObjectURL(file);
        }
        else if (window.URL != undefined)
        {
            url = window.URL.createObjectURL(file);
        }
        else if (window.webkitURL != undefined)
        {
            url = window.webkitURL.createObjectURL(file);
        }
        return url;
    }
</script>
{/block}